<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript">
    var arr = [18, 45, 0, 58, 32,59]
    arr.sort();
    for (var i = 0; i < arr.length; i++) {
        //alert(arr[i]);
        console.log(arr[i]);
    }
</script>
</body>
</html>